package com.example.stockservice.controller;

import com.example.stockservice.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService stockService;

    @PostMapping("/record/deduct")
    public Boolean recordDeduct(@RequestParam String productId, @RequestParam Integer count) {
        return stockService.recordDeduct(productId, count);
    }
    @GetMapping("/record/deduct")
    public Boolean getOrder(@RequestParam String productId, @RequestParam Integer count) {
        return stockService.recordDeduct(productId, count);
    }
}
    